<?php 
$id = get_the_ID();
$servicio = get_post_meta($id, 'Servicio', true);
$creditos_single = get_post_meta($id, 'creditos_single', true);
$url = get_post_meta($id, 'url', true);
$familia = get_post_meta($id, 'familia', true);
$foto_slider_1 = get_post_meta($id, 'img_slider_1',true);
$foto_slider_2 = get_post_meta($id, 'img_slider_2',true);
$foto_slider_3 = get_post_meta($id, 'img_slider_3',true);
$no_post = array();
$no_post[] = $id;
?>
<!-- INICIA EL POST -->
<div class="container marketing" id="content-portafolio-single">
	<div class="content-page">
            <div id="head-hide"></div>
            <div id="title-portafolio">
				<h1>PORTAFOLIO</h1>
            </div>
			<!-- Breadcrumb -->
			<?php the_breadcrumb(); ?>
			<!-- Fin Breadcrumb -->

			<div class="row-fluid">
				<div class="span8">
					<div class="span12">
						<div class="slider">
							<ul class="bxslider">
								<li><img src="<?php echo wp_get_attachment_url($foto_slider_1);?>" /></li>
								<li><img src="<?php echo wp_get_attachment_url($foto_slider_2);?>" /></li>
								<li><img src="<?php echo wp_get_attachment_url($foto_slider_3);?>" /></li>
							</ul>
						</div>
					</div>
					<div class="span6">
						<div id="title-portafolio">Servicios</div>  
						<ul class="content-servicio-ul">
							
							<?php
							$post_categories = wp_get_post_categories( $id );

							foreach($post_categories as $c){
								$cat = get_category( $c );
								if($cat->slug != "blog" && $cat->slug != "equipo" && $cat->slug != "portafolio" && $cat->slug != "clientes" && $cat->slug != "plataformas-propias" && $cat->slug != "servicios"){ ?>
								<li>
									<a href="javascript:void(0)" title="<?php echo $cat->name;?>"><img src="<?php  bloginfo( 'template_url' ); ?>/img/<?php  echo $cat->slug.'.png'; ?>"></a>
								</li>
									
								<?php }
							}

							?>
						</ul>
					</div>
					<div class="span6">
						<div id="title-portafolio">Creditos</div>
						<div class="desc-single"><?php echo $creditos_single;?></div>                            
					</div>
				</div>
				<div class="span4" id="content-sinlgle-left">
					<h2 class="title-right"><?php the_title();?></h2>
					<div class="url-single"><?php echo $url;?></div>
					<div class="extracto-single"><?php the_excerpt();?></div>
					<?php the_content();?>

				</div>
			</div>
			<div class="row-fluid">
                            <div id="title-portafolio-otros">
									<h2>Otros proyectos para esta marca</h2>
                            </div>
				<div class="section-container clearfix">
					<div class="item-list clearfix" id="portafolio-items">
				<?php
					$query = new WP_Query( array( 'meta_key' => 'familia', 'meta_value' => $familia , 'post__not_in' => array( $id ) ) );
					if ( $query->have_posts() ) {
						while ( $query->have_posts() ) { 
							$query->the_post();
							
							
							echo "<div class='span4 item'>";
							echo "<div class='img-experto'>";
							echo "<a href='". get_permalink()."' title='". get_the_title()."'><p>". get_the_post_thumbnail()."</p></a>";
							echo "</div>";
							echo "<div class='titulo-portafolio'><a href='". get_permalink()."'>". get_the_title() ."</a></div>";
							echo "<div class='extracto-portafolio'>". get_the_excerpt() ."</div>";
							echo "</div>";
                                                        $no_post[] = $query->post->ID;
						}
					}
				?>				
					</div>
				</div>
			</div>
                        <div class="row-fluid">
                            <div id="title-portafolio-relacionados">
                                                <h2>Proyectos Relacionados</h2>
                            </div>
                            <?php
					$query = new WP_Query( array('post__not_in' => $no_post,'category_name' =>'portafolio','posts_per_page' => 4, 'orderby' => 'rand') );
					if ( $query->have_posts() ) {
						while ( $query->have_posts() ) { 
							$query->the_post();
							
							
							echo "<div class='span3 item-otros'>";
							echo "<div class='img-experto'>";
							echo "<a href='". get_permalink()."' title='". get_the_title()."'><p>". get_the_post_thumbnail()."</p></a>";
							echo "</div>";
							echo "<div class='titulo-portafolio-otros'>". get_the_title() ."</div>";
							echo "</div>";
						}
					}
				?>
                        </div>
		
		
	</div>
	
</div>

<!-- TERMINA CONTENIDO DEL POST -->
